<template>
  <div>
    <el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px">
      <el-form-item label="用户" prop="user_id">
        <el-input v-model="formData.user_id" placeholder="请输入用户" clearable :style="{width: '100%'}">
        </el-input>
      </el-form-item>
      <el-form-item label="社团" prop="club_id">
        <el-select v-model="formData.club_id" placeholder="请选择社团" clearable :style="{width: '100%'}">
          <el-option v-for="(item, index) in club_idOptions" :key="index" :label="item.label"
            :value="item.value" :disabled="item.disabled"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="招聘岗位" prop="recruitment_id">
        <el-select v-model="formData.recruitment_id" placeholder="请选择招聘岗位" clearable :style="{width: '100%'}">
          <el-option v-for="(item, index) in recruitment_idOptions" :key="index" :label="item.label"
            :value="item.value" :disabled="item.disabled"></el-option>
        </el-select>
      </el-form-item>
      <el-form-item label="简历内容" prop="resume_content">
        <el-input v-model="formData.resume_content" type="textarea" placeholder="请输入简历内容"
          :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
      </el-form-item>
      <el-form-item label="备注" prop="remark">
        <el-input v-model="formData.remark" type="textarea" placeholder="请输入备注"
          :autosize="{minRows: 4, maxRows: 4}" :style="{width: '100%'}"></el-input>
      </el-form-item>
      <el-form-item size="large">
        <el-button type="primary" @click="submitForm">提交</el-button>
        <el-button @click="resetForm">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<script>
export default {
  components: {},
  props: [],
  data() {
    return {
      formData: {
        user_id: undefined,
        club_id: undefined,
        recruitment_id: undefined,
        resume_content: undefined,
        remark: undefined,
      },
      rules: {
        user_id: [{
          required: true,
          message: '请输入用户',
          trigger: 'blur'
        }],
        club_id: [{
          required: true,
          message: '请选择社团',
          trigger: 'change'
        }],
        recruitment_id: [{
          required: true,
          message: '请选择招聘岗位',
          trigger: 'change'
        }],
        resume_content: [{
          required: true,
          message: '请输入简历内容',
          trigger: 'blur'
        }],
        remark: [{
          required: true,
          message: '请输入备注',
          trigger: 'blur'
        }],
      },
      club_idOptions: [{
        "label": "选项一",
        "value": 1
      }, {
        "label": "选项二",
        "value": 2
      }],
      recruitment_idOptions: [{
        "label": "选项一",
        "value": 1
      }, {
        "label": "选项二",
        "value": 2
      }],
    }
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {},
  methods: {
    submitForm() {
      this.$refs['elForm'].validate(valid => {
        if (!valid) return
        // TODO 提交表单
      })
    },
    resetForm() {
      this.$refs['elForm'].resetFields()
    },
  }
}

</script>
<style>
</style>
